Moist GCM with large scale condensation only


Here, CliMT is configured as a simple moist GCM with a grey radiation scheme and the simple physics package (Reed and Jablonowski (2012)) to provide surface fluxes, a boundary layer and large scale condensation.

The GCM generates a weak circulation, and the vertical transport of temperature and moisture are limited since no convection is present. The weak circulation is a consequence of no water vapour sensitivity in the radiation scheme.


In [1]:
%matplotlib notebook

from climt.dynamics import dynamics
from climt.simple_physics_custom import simple_physics_custom
from climt.federation import federation
import climt

import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
sns.set_style('whitegrid',rc={'grid.linestyle':'dotted', 'grid.color':'0.0'})
# Dynamical core parameters
import matplotlib as mpl

global_time_step = 1200.

kwargs = {}
kwargs['dt'] = global_time_step
kwargs['nlon'] = 96
kwargs['nlat'] = 44

#Init the dynamics Component
dycore = dynamics(scheme='gfs', **kwargs)

#Get the pressure and lat/lon values
pressure = dycore['p']
ps = dycore['ps']

full_latitudes = dycore.Extension.latitudes
full_longitudes = dycore.Extension.longitudes

dycore_grid = dycore.Grid


Using netCDF4 interface for IO
Lats, lons, levs, trunc, dims, tracers 44 96 28 30 496 1

In [2]:
#Setup simple physics

kwargs['grid'] = dycore_grid
kwargs['dt'] = global_time_step
kwargs['p'] = pressure
kwargs['pint'] = dycore['pint']
kwargs['use_ext_ts'] = True

#set surface temperatures
eq_pole_temp_gradient = 20.
max_temp = 280.

delta = eq_pole_temp_gradient/max_temp

Ts = max_temp*(1 - delta*np.sin(full_latitudes)**2)

kwargs['Ts'] = Ts

phys = simple_physics_custom(**kwargs)

#Initialise radiation
kwargs = {}
#kwargs['UpdateFreq'] = 3600.
kwargs['grid'] = dycore_grid

rad = climt.radiation(scheme='newgreygas', **kwargs)

In [3]:
#Setup federation
kwargs = {}
kwargs['Ts'] = Ts
kwargs['MonitorFields'] = ['U','q','V','precc'] # Display zonal velocity during simulation
kwargs['MonitorFreq'] = 3600.*6 #6 hourly update
kwargs['grid'] = dycore_grid

fed = federation(dycore, rad, phys, **kwargs)


gfs_dynamics  can integrate  ['U', 'V', 'T', 'q', 'ps']
All fields integrated by federation members:  ['U', 'V', 'T', 'q', 'ps']
All fields returned by federation members:  ['U', 'V', 'T', 'q', 'ps', 'p', 'pint']

In [4]:
#Run the code for 10 days. each time step is 1200 seconds = 1/3 hour
num_steps = 500*24*3
for i in range(num_steps):
    #Integrate one time step
    fed.step()


---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-4-e294eb45de24> in <module>()
      3 for i in range(num_steps):
      4     #Integrate one time step
----> 5     fed.step()

/home/joymm/github/joyClimt/lib/python2.7/site-packages/climt/component.pyc in step(self, RunLength, Inc)
    182 
    183 
--> 184                 OutputValues = self.integrate(Input,InputTend)
    185 
    186                 if len(self.FromExtension) == 1: Output = {self.FromExtension[0]: OutputValues}

/home/joymm/github/joyClimt/lib/python2.7/site-packages/climt/federation.pyc in integrate(self, field_list, increment_list)
    228                 InputTend.append(increment_list[index])
    229 
--> 230             OutputValues = component.integrate(Input, InputTend)
    231 
    232             for field in component.FromExtension:

_gfs_dynamics.pyx in _gfs_dynamics._gfs_dynamics.integrateFields (_gfs_dynamics.c:11961)()

/usr/local/lib/python2.7/dist-packages/numpy/core/numeric.pyc in asfortranarray(a, dtype)
    569     return array(a, dtype, copy=False, order='C', ndmin=1)
    570 
--> 571 def asfortranarray(a, dtype=None):
    572     """
    573     Return an array laid out in Fortran order in memory.

KeyboardInterrupt: 

In [ ]:
del(dycore)
del(fed)